function sum(discount = 0, ...price) {
  let total = price.reduce((a, b) => a + b);
  console.log(total);
  return Math.round(total * (1 - discount));
}
console.log(sum(0.5, 199, 2010, 123));
